import request from '@/config/axios'

// 查询机器人 分页
export const getRobotPage = (params: PageParam) => {
  return request.get({ url: '/robot/page', params })
}

// 删除机器人
export const deleteRobot = (data) => {
  return request.post({ url: '/robot/delete',data })
}

// 新增机器人
export const saveRobot = (data) => {
  return request.post({ url: '/robot/save',data })
}
// 修改机器人
export const updateRobot = (data) => {
  return request.post({ url: '/robot/update',data })
}

// 详情机器人
export const getByIdRobot = (params) => {
  return request.get({ url: '/robot/getById',params })
}
// 启用/禁用机器人
export const updateValid = (data) => {
  return request.post({ url: '/robot/isValid',data })
}

// 查询所有启用机器人 参数: type   (0企业微信  1钉钉)
export const getRobotgetAll = (params) => {
  return request.get({ url: '/robot/getAll', params })
}
/*****************************发送消息规则****************************** */

// 查询 分页
export const getmessageRulePage = (params: PageParam) => {
  return request.get({ url: '/messageRule/page', params })
}

// 删除
export const deletemessageRule = (data) => {
  return request.post({ url: '/messageRule/delete',data })
}

// 新增
export const savemessageRule = (data) => {
  return request.post({ url: '/messageRule/save',data })
}
// 修改
export const updatemessageRule = (data) => {
  return request.post({ url: '/messageRule/update',data })
}

// 详情
export const getByIdmessageRule = (params) => {
  return request.get({ url: '/messageRule/getById',params })
}

/*****************************发送文件规则****************************** */

// 查询 分页
export const getfileNoticeRulePage = (params: PageParam) => {
  return request.get({ url: '/fileNoticeRule/list', params })
}

// 删除
export const deletefileNoticeRule = (data) => {
  return request.post({ url: '/fileNoticeRule/delete',data })
}

// 新增/修改
export const savefileNoticeRule = (data) => {
  return request.post({ url: '/fileNoticeRule/saveOrUpdate',data })
}
// 更新状态
export const updatefileNoticeisValid = (data) => {
  return request.post({ url: '/fileNoticeRule/isValid',data })
}

// 详情
export const getByIdfileNoticeRule = (params) => {
  return request.get({ url: '/fileNoticeRule/getById',params })
}
/*****************************消息记录****************************** */

// 消息记录查询 分发 送类型标识 * 1、企业微信 * 2、钉钉群 * 3、FTP * 4、邮箱 * 5 网盘 * 6 会议 * 7 消息必达页
export const getsendMessagePage = (params: PageParam) => {
  return request.get({ url: '/sendMessage/list', params })
}
// 详情
export const getByIdsendMessage = (params) => {
  return request.get({ url: '/sendMessage/getById',params })
}